package com.wangshouyu.mp.pay.v3.transactions;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @description 支付者
 * @date 2020/8/14 9:53
 */
public class TransactionPayer implements Serializable {

    /**
     * 用户标识
     */
    @SerializedName(value = "openid")
    @JsonProperty(value = "openid")
    @JSONField(name = "openid")
    private String openId;

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TransactionPayer that = (TransactionPayer) o;
        return Objects.equals(openId, that.openId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(openId);
    }

    @Override
    public String toString() {
        return "TransactionPayer{" +
                "openId='" + openId + '\'' +
                '}';
    }

    public TransactionPayer(String openId) {
        this.openId = openId;
    }

    public TransactionPayer() {
    }
}
